<template>
  <view class="empty-box" :style="{ 'padding-top': mTop }">
    <image
      class="empty-img"
      :src="imgSrc"
      :class="locate ? 'locate-img' : ''"
    ></image>
    <view class="txt" :class="locate ? 'locate' : ''">{{ title }}</view>
  </view>
</template>

<script>
export default {
  props: {
    imgSrc: {
      type: String,
      default: "/static/images/empty-box.gif",
    },
    title: {
      type: String,
      default: "暂无记录",
    },
    mTop: {
      type: String,
      default: "50%",
    },
    // 是否需要定位文案位置
    locate: {
      type: Boolean,
      default: false,
    },
  },
  data() {
    return {
      urlDomain: this.$Cache.get("imgHost"),
    };
  },
};
</script>

<style lang="scss" scoped>
.empty-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding-bottom: 60rpx;
  position: relative;
  .empty-img {
    width: 440rpx;
    height: 360rpx;
  }

  .txt {
    font-size: 26rpx;
    color: #999;
  }
  .locate {
    position: absolute;
    bottom: 150rpx;
    left: 50%;
    transform: translateX(-50%);
    color: #000000 !important;
  }
}
.locate-img {
  width: 460rpx !important;
  height: 460rpx !important;
}
</style>
